<%= form_for(@course) do |f| %>
  <% if @course.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@course.errors.count, "error") %> prohibited this course from being saved:</h2>

      <ul>
        <% @course.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </div>
  <div class="field">
    <%= f.label :classroom %><br />
    <%= f.text_field :classroom %>
  </div>
  <div class="field">
    <%= f.label :duration %><br />
    <%= f.text_field :duration %>
  </div>
  <div class="field">
    <%= f.label :started_at %><br />
    <%= f.date_select :started_at %>
  </div>
  <div class="field">
    <%= f.label :finished_at %><br />
    <%= f.date_select :finished_at %>
  </div>
  <div class="field">
    <%= f.label :menu %><br />
    <%= f.text_area :menu %>
  </div>
  <div class="field">
    <%= f.label :objective %><br />
    <%= f.text_area :objective %>
  </div>
  <div class="field">
    <%= f.label :programatic_content %><br />
    <%= f.text_area :programatic_content %>
  </div>
  <div class="field">
    <%= f.label :bibliography %><br />
    <%= f.text_area :bibliography %>
  </div>
  <div class="field">
    <%= f.label :published %><br />
    <%= f.label "Sim" %> <%= radio_button(:course, :published , "S") %>
    <%= f.label "Não" %> <%= radio_button(:course, :published , "N") %>
  </div>
  <div class="field">
    <%= f.label :minimum %><br />
    <%= f.text_field :minimum %>
  </div>
  <div class="field">
    <%= f.label :maximum %><br />
    <%= f.text_field :maximum %>
  </div>
  <div class="field">
    <%= f.label :user %><br />
    <% options = User.find_all_by_type("Teacher", :order => "name").collect { |teacher| [teacher.name, teacher.id] } %>
    <%= select(:course, :user_id , options, :prompt => ">> Choose <<") %>
  </div>
  <div class="field">
    <%= f.label :category %><br />
    <% options = Category.all(:order => "name").collect {|category| [category.name,category.id]} %>
    <%= select(:course, :category_id , options, :prompt => ">> Choose <<") %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
